class CreateVals < ActiveRecord::Migration
  def self.up
    create_table :vals do |t|
      t.column :seq, :integer
      t.column :desc, :text
    end

    create_table :vals_words, :id => false do |t|
      t.column "val_id", :integer, :default => 0, :null => false
      t.column "word_id", :integer, :default => 0, :null => false
      t.column :created_at, :datetime
      t.column :updated_at, :datetime
    end
    
    create_table :props_vals, :id => false do |t|
      t.column "prop_id", :integer, :default => 0, :null => false
      t.column "val_id", :integer, :default => 0, :null => false
      t.column :created_at, :datetime
      t.column :updated_at, :datetime
    end
  end

  def self.down
    drop_table :vals
    drop_table :vals_words
    drop_table :props_vals
  end
end
